package com.zhl.media.app.mvp.model.api.service;

import com.zhl.media.app.model.OffLineData;
import com.zhl.media.commonsdk.base.BaseRespose;
import com.zhl.media.commonsdk.entity.Hm;
import com.zhl.media.commonsdk.entity.MyPushPicture;
import com.zhl.media.commonsdk.entity.MyPushResultApp;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;

import static com.zhl.media.app.mvp.model.api.Api.APP_DOMAIN_NAME;
import static me.jessyan.retrofiturlmanager.RetrofitUrlManager.DOMAIN_NAME_HEADER;

public interface AppService {

    //获取更新信息
    @GET("packagemanage/checkupdate")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<Map>> checkupdate();

    //通过ID获取信息
    @GET("appDept")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<Map>> getUserInfo();

    //获取工作任务
    @GET("app/appFirstPage/{date}")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<OffLineData>> getListProj(@Path("date") String date);

    //获取本期方案时间
    @GET("time/getSaturday")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<String>> getThisDate();

    //获取广告画面
    @GET("appProgram/info/{date}")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<List<Hm>>> getAppProgram(@Path("date") String date);

    //添加调整结果
    @POST("pushResult/saveAbnormalInfo")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<String>> saveAbnormalInfo(@Body RequestBody route);

    @GET("my/pushResult/{pushDate}")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<MyPushResultApp>> pushResult(@Path("pushDate") String pushDate);

    @GET("my/imageList/{pushDate}")
    @Headers({DOMAIN_NAME_HEADER + APP_DOMAIN_NAME})
    Observable<BaseRespose<List<MyPushPicture>>> currentPushImgList(@Path("pushDate") String pushDate);
}
